<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入静态文件 -->
    <link rel="stylesheet" href="{{asset('admin')}}/common/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="{{asset('admin')}}/common/font-awesome-4.2.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="{{asset('admin')}}/common/toastr.js/2.1.4/toastr.min.css">
    <link rel="stylesheet" href="{{asset('admin')}}/css/login.css">
    <script src="{{asset('admin')}}/common/jquery/1.12.4/jquery.min.js"></script>
    <script src="{{asset('admin')}}/common/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
    <script src="{{asset('admin')}}/common/toastr.js/2.1.4/toastr.min.js"></script>
    <script src="{{asset('admin')}}/js/main.js"></script>
    <title>登录</title>
</head>
<body class="login">

<div class="container formBox">
    {{--  登录表单--}}
    <h3>后台管理系统</h3>
    <form  action="{{ url('admin/check') }}" method="post" class="j-login">
        <div class="form-group">
            <label for="inputUserName">用户名</label>
            <input type="text" class="form-control" id="inputUserName" name="username" placeholder="用户名" required>

        </div>
        <div class="form-group">
            <label for="exampleInputPassword1">密码</label>
            <input type="password" class="form-control" id="exampleInputPassword1" name="password" placeholder="密码" required>
        </div>
        <div class="form-group">
            <input type="text" name="captcha" class="form-control" placeholder="验证码" required>
        </div>
        <div class="form-group">
            <div class="login-captcha"><img src="{{ captcha_src() }}" alt="captcha"></div>
        </div>
        <div class="form-group form-check">
            <input type="checkbox" class="form-check-input" id="exampleCheck1">
            <label class="form-check-label" for="exampleCheck1">记住账号</label>
        </div>
        <div class="form-group">
            {{csrf_field()}}
            <input type="submit" class="btn btn-lg btn-block btn-primary" value="登录">
        </div>
    </form>
</div>
<div class="img-box">
    <img src="{{asset('admin')}}/img/wallhaven-k7v9yq.png" alt="">
</div>
<script>
    $('.login-captcha img').click(function() {
        $(this).attr('src', '{{ captcha_src()}}' + '?_=' + Math.random());
    });
    main.ajaxForm('.j-login', function() {
        location.href = '/admin/index';
    });
</script>
</body>
</html>
